package com.x.reader.controller;

import com.x.framework.Base;
import com.x.framework.model.ResData;
import com.x.reader.model.App;
import com.x.reader.service.AppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RestController
public class AppController extends Base {

    @Autowired
    private AppService appService;

    @RequestMapping(value = "/SelectAppList")
    public ResData selectAppList(App app) {
        List<App> appList = appService.selectAppList(app);
        ResData resData = new ResData(0);
        if (appList.size() > 0) {
            app = appList.get(0);
            resData.setCode(1);
            resData.setResult(app);
        }
        return resData;
    }

}
